var api = require('./api.js')
var request = require('./request.js')

function getHome(parms) {
	return request.requestApi({
		url: api.homeApi
	})
}

function getList(parms) {
	return request.requestApi({
		url: api.listApi,
		data: parms
	})
}

function LoginFn(parms) {
	return request.requestApi({
		url: api.loginApi,
		data: parms,
		header: {
			'content-type': 'application/x-www-form-urlencoded'
		},
		method: 'POST'
	})
}

//精品推荐
function getJingpin() {
	return request.requestApi({
		url: api.getJingpin
	})
}

function CodeFn(parms) {
	return request.requestApi({
		url: api.CodeFnApi,
		data: parms,
		header: {
			'content-type': 'application/x-www-form-urlencoded'
		},
		method: 'POST'
	})
}

module.exports = {
	getHome: getHome,
	getList: getList,
	getJingpin:getJingpin
}